<?php 
	include('template/header.php');
	include('classess/user_subscribe.php');	
	
?>
	<section  class="homepage-slider" id="home-slider">
		<div class="flexslider">
			<ul class="slides">
				<li>
					<img src="img/slider/first_image.jpg" alt="No Image" />					
				</li>
				<li>
					<img src="img/slider/second_image.jpg" alt="No Image" />					
				</li>
			</ul>
		</div>			
	</section>
	<section class="main-content">
		<div class="row">

			<div class="span9">													
				<div class="row">
					<div class="span9">
						<h4 class="title">
							<span class="pull-left"><span class="text"><span class="line"><strong>Ebooks</strong></span></span></span>
							<span class="pull-right">
								&nbsp;
							</span>
						</h4>
						<?php 
							if(isset($_GET['prv_msg_set'])){
								if($_GET['prv_msg_set'] == '1'){
						?>
						<div class="alert alert-error">
							<div style="float: right; width: 5%;"><button type="button" class="close" data-dismiss="alert">&times;</button></div>
							<div style="float:left;width: 92%;word-wrap: break-word;"><?php echo 'Your Email And Password has been sent in your mail For login.'; ?></div>
							<div style="clear:both;"></div>							
						</div>
						<?php
								}
							}
						?>
						<div id="myCarousel" class="myCarousel carousel slide">
							<div class="carousel-inner">
								<div class="active item">
									<ul class="thumbnails">	
										<?php
											$sel_course = "SELECT * FROM tbl_ebook where ebook_is_active = '1'";
											$query_courses = mysql_query($sel_course) or die(mysql_error());

											if(mysql_num_rows($query_courses)){
												while($row = mysql_fetch_array($query_courses)){
													$crsimg_ext = $row['ebook_image'];
													$temp = explode(".", $crsimg_ext);
													$extension = end($temp);
										?>
											<li class="span3">
												<div class="product-box">
													<span class="sale_tag"></span>
													<p><a href="course_description.php?ebk=1&c_id=<?php echo $row['id']; ?>&ebk_chk=1"><img src="admin/dashboard/ebook_images/<?php echo $row['id'].'/'.$row['id'].'.'.$extension; ?>" alt="" /></a></p>
													<a href="course_description.php?ebk=1&c_id=<?php echo $row['id']; ?>&ebk_chk=1"><?php echo $row['ebook_name']; ?></a><br/>
													<p class="price"><?php echo '$'.$row['ebook_fee']; ?></p>

													<div class="cart">
														<a href="course_description.php?ebk=1&c_id=<?php echo $row['id']; ?>&ebk_chk=1"><input type="button" value="Pay Now" class="add_to_cart"></a>
													</div>
												</div>
											</li>		
										<?php
												}		
											}
										?>
									</ul>
								</div>
							</div>							
						</div>
					</div>						
				</div>	
			</div>

			<?php include('template/right_panel.php'); ?>
		</div>
	</section>
   
<?php include('template/footer.php'); ?>
<script>
	$('.close').click(function(){
		$('.alert-error').addClass('hide');
	});
</script>
